#include <iostream>
#include <cstdio>
#include <cstring>
 
#define mem(x)  memset((x),0,sizeof((x)))
#define inf 0x7fffffff
#define MAXN 10+1000
using namespace std;
long long a[MAXN]={4,3};
#define M 10000000000000000000
#define MAXN_LL 0x7fffffffffffffffll
void init()
{
    for(int i = 2; i <= 88; i++)
        a[i] = a[i-1] + a[i-2];
    a[89] = MAXN_LL;
}
 
int main()
{
    //freopen("in.txt","r",stdin);
   init();
    long long n;
    while(cin>>n){
 
    while(n > 7){
        int k = 0;
        while(a[k++] < n);
        n = n - a[k-2];
    }
    switch(n)
    {
    case 0:
    case 4:
    case 7:
        cout<<"^";
        break;
    case 1:
    case 3:
        cout<<"T";
        break;
    case 2:
        cout<<".";
        break;
    case 5:
    case 6:
        cout<<"_";
        break;
    default:
        cout<<"error";
    }
    cout<<endl;
 
    }
    return 0;
}
